



//
//  ZYUnratifiedsCell.m
//  优学荟管理系统
//
//  Created by edz on 2017/12/25.
//  Copyright © 2017年 星道三好. All rights reserved.
//

#import "ZYUnratifiedsCell.h"
#import "ZYUnratifiedsModel.h"
@implementation ZYUnratifiedsCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
     
        [self setUpSuperView];
        
    }
    
    
    return self;
    
    
    
    
}


- (void)assignByZYUnratifiedsModel:(ZYUnratifiedsModel *)model{
    
    
    BOOL isUp = [NSString isBlankString:model.petname];
    if (isUp) {
          self.studentLabel.text = @"学生：";
    }else{
          self.studentLabel.text = [NSString stringWithFormat:@"学生：%@",model.petname];
    }
    
    
   
    
    self.timeLabel.text = [NSString stringWithFormat:@"布置时间：%@",model.submitTime];
    
    
    
    
    
    
}




- (void)setUpSuperView{
    
   
    self.studentLabel = [UILabel new];
    self.studentLabel.font = [UIFont systemFontOfSize:16];
    self.studentLabel.tintColor = ColorRGB(102, 102, 102);
    [self.contentView addSubview:self.studentLabel];
    
    self.timeLabel = [UILabel new];
    self.timeLabel.font = [UIFont systemFontOfSize:12];
    self.timeLabel.tintColor = ColorRGB(102, 102, 102);
    [self.contentView addSubview:self.timeLabel];
    
    
    self.markingButton = [UIButton buttonWithType:(UIButtonTypeCustom)];
    self.markingButton.titleLabel.font = [UIFont systemFontOfSize:14];
    [self.markingButton setTitle:@"批阅" forState:(UIControlStateNormal)];
    [self.markingButton setTitleColor:ColorRGB(255, 255, 255) forState:(UIControlStateNormal)];
    [self.markingButton setBackgroundImage:[UIImage imageNamed:@"btn_read_over_default"] forState:(UIControlStateNormal)];    [self.contentView addSubview:self.markingButton];
    
    
    self.studentLabel.text = @"学生：余周周";
    [self.studentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(kScreenWidth *32/750);
        make.top.offset(kScreenHeight *50/1334);
    }];
    
    
    self.timeLabel.text = @"2017.12.25";
    [self.timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.studentLabel);
        make.top.equalTo(self.studentLabel.mas_bottom).offset(kScreenHeight *30/1334);
    }];
    
    [self.markingButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self).offset(-kScreenWidth *32/750);
        make.centerY.equalTo(self);
    }];
    
    
    
    UILabel *lineLabel = [UILabel new];
    lineLabel.backgroundColor = ColorRGB(247, 245, 245);
    [self.contentView addSubview:lineLabel];
    [lineLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(0);
        make.top.equalTo(self.timeLabel.mas_bottom).offset(kScreenHeight *50/1334);
        make.width.offset(kScreenWidth);
        make.height.offset(kScreenHeight *20/1334);
    }];
    
    
    
    
    [self.contentView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.offset(0);
        make.bottom.mas_equalTo(lineLabel).offset(0);
    }];
    
    
    
    
    
    
    
    
    
    
}
















@end
